Skip to content

borealis: share compute derivatives, float32 atomics, D16S8, and ASTC HDR across all chips - #929

Merged
RyanTheTide merged 3 commits into
aurora-wipfrom
feat/borealis-shared-shader-format-caps
Nov 24, 2026
Merged

RyanTheTide merged 3 commits into
aurora-wipfrom
feat/borealis-shared-shader-format-caps

Conversation

@RyanTheTide

@RyanTheTide RyanTheTide commented Nov 24, 2026 •

Copy link
Copy Markdown

Problem

Four shared NIR shader and hardware format capabilities in Borealis remained gated to G17P and/or M5 even though the underlying lowering and hardware format support are present across all Apple Silicon GPU generations (G13-G17):

  • VK_KHR_compute_shader_derivatives (computeDerivativeGroupQuads / computeDerivativeGroupLinear): lowered in NIR via quad swaps and explicit-gradient texture ops (agx_nir_lower_compute_derivatives), already supported on AGX2 and AGX3.
  • VK_EXT_shader_atomic_float and VK_EXT_shader_atomic_float2 (plus R32_FLOAT storage image & texel buffer atomics): lowered in agx_nir_lower_atomics() via 32-bit integer CAS loops on AGX2/AGX3C and native FP32 fadd + CAS on AGX3B.
  • VK_FORMAT_D16_UNORM_S8_UINT: backed by independent Z16 and S8 planes in ZLS and split depth/stencil meta copies across all generations.
  • VK_EXT_texture_compression_astc_hdr: supported in hardware by Apple Silicon texture units from G13 onward with existing ASTC float format mappings in src/asahi/layout/formats.c.

Supersedes the earlier draft Airs-only subset in #816 and extends full coverage cleanly to AGX2 (G13/G14), native AGX3 (G15/G16/G17P), and M5 without adding chip gates.

Change

  • Expose VK_KHR_compute_shader_derivatives, VK_EXT_shader_atomic_float, VK_EXT_shader_atomic_float2, VK_EXT_texture_compression_astc_hdr, and VK_FORMAT_D16_UNORM_S8_UINT uniformly across all Borealis generations.
  • Drive compute/mesh/task derivative NIR preprocessing in hk_preprocess_nir() directly from vk_pdev->supported_features.computeDerivativeGroupQuads and vk_pdev->properties.meshAndTaskShaderDerivatives instead of chip-ID checks.
  • Key R32_FLOAT storage image and texel buffer atomic format feature bits in hk_image.c and hk_buffer_view.c directly on supported_features.shaderImageFloat32Atomics instead of agx_chip_g17p_or_m5().
  • No new chip gates; zero overlap with #824, #810, #812, #813, #416, #456.

Testing

Exact head 6ce015f76154 (arm64 ICD libvulkan_asahi.so sha256 a2f7d4bfddaf20ad... vs aurora-wip 912c9e4cc7e sha256 18224556d3f83964..., userspace-only via VK_DRIVER_FILES, 0 GPU faults, 0 new AVCs, Enforcing, 0 failed units):

  • Host unit tests: meson test --suite asahi 245/245 PASS.
  • J413 (M2 Air, G14G AGX2, fleet87): derivatives 0 -> 20/72 Pass, atomic_float 0 -> 24/76 Pass (compute/fragment buffer/shared/image/texel-buffer; remaining 28 require vertexPipelineStoresAndAtomics), d16s8 0 -> 49/72 Pass, astc_hdr 0 -> 12/72 Pass (+105 NS -> Pass, 0 Fail), control 87/96 identical.
  • J713 (M4 Air, G16G AGX3, fleet85): derivatives 0 -> 20/72 Pass, atomic_float 0 -> 52/76 Pass, d16s8 0 -> 52/72 Pass, astc_hdr 0 -> 12/72 Pass (+136 NS -> Pass, 0 Fail), control 95/95 identical.
  • Neo (A18 Pro, G17P regression, fleet87): derivatives 72/72, atomic_float 52/76, d16s8 53/72, astc_hdr 12/72, control 96/96 — 100% identical, 0 regressions.

Still to run

  • G13 (J316s M1 Pro) and G15 (J615 M3 Air) exact-head CTS rows are queued on lab hardware and will be posted as a PR comment once their current locks clear.
  • M5 (HAL300) VK_EXT_texture_compression_astc_hdr verification row (the other three were already enabled on M5).
Exact-head CTS matrix & environment receipts (6ce015f)
Machine SoC / Gen Kernel Arm derivatives (72) atomic_float (76) d16s8 (72) astc_hdr (72) control GPU faults / New AVCs
J413 (M2 Air) G14G (AGX2) 7.3.0-aurora-fleet87 base 0/72 Pass, 72 NS 0/76 Pass, 76 NS 0/72 Pass, 72 NS 0/72 Pass, 72 NS 87/96 Pass, 0 Fail 0 / 0
J413 (M2 Air) G14G (AGX2) 7.3.0-aurora-fleet87 b2 (6ce015f7615) 20/72 Pass, 0 Fail 24/76 Pass, 0 Fail 49/72 Pass, 0 Fail 12/72 Pass, 0 Fail 87/96 Pass, 0 Fail 0 / 0
J713 (M4 Air) G16G (AGX3) 7.3.0-aurora-fleet85 base 0/72 Pass, 72 NS 0/76 Pass, 76 NS 0/72 Pass, 72 NS 0/72 Pass, 72 NS 95/95 Pass, 0 Fail* 0 / 0
J713 (M4 Air) G16G (AGX3) 7.3.0-aurora-fleet85 b2 (6ce015f7615) 20/72 Pass, 0 Fail 52/76 Pass, 0 Fail 52/72 Pass, 0 Fail 12/72 Pass, 0 Fail 95/95 Pass, 0 Fail* 0 / 0
Neo G17P (AGX3) 7.3.0-aurora-fleet87 base 72/72 Pass, 0 Fail 52/76 Pass, 0 Fail 53/72 Pass, 0 Fail 12/72 Pass, 0 Fail 96/96 Pass, 0 Fail 0 / 0
Neo G17P (AGX3) 7.3.0-aurora-fleet87 b2 (6ce015f7615) 72/72 Pass, 0 Fail 52/76 Pass, 0 Fail 53/72 Pass, 0 Fail 12/72 Pass, 0 Fail 96/96 Pass, 0 Fail 0 / 0

*J713 fleet85 has one pre-existing baseline MSAA depth submit EINVAL (std_sample_locations.draw.depth), identical across base and b2; all other 95/95 control cases pass.

ICD SHA-256:

  • base (912c9e4cc7e): 18224556d3f839649cc03e525696211342944e49dc5b3b3d3efc8686a5d37797
  • b2 (6ce015f7615407fe191b065916f3459684e1fbc7): a2f7d4bfddaf20ad86bd91b7f4204b8d02f039683d19a7cf05485c4e7e89ecaf

… HDR across all chips

Remove qualification-only chip gates for shared NIR shader capabilities and
hardware image formats supported across all Apple Silicon GPU generations
(G13-G17):

- VK_KHR_compute_shader_derivatives: lowered in NIR via quad swaps and
  explicit-gradient texture operations; drive shader preprocessing directly
  from supported_features.computeDerivativeGroupQuads and
  properties.meshAndTaskShaderDerivatives.
- VK_EXT_shader_atomic_float and VK_EXT_shader_atomic_float2: lowered via
  agx_nir_lower_atomics() (CAS loops on AGX2/AGX3C, native fp32 add + CAS
  on AGX3B); key R32_FLOAT storage image and texel buffer atomic format
  features directly on supported_features.shaderImageFloat32Atomics.
- VK_FORMAT_D16_UNORM_S8_UINT: backed by independent Z16 and S8 planes in
  ZLS and depth/stencil aspect meta copies across all generations.
- VK_EXT_texture_compression_astc_hdr: supported by Apple Silicon texture
  units from G13 onward with existing ASTC float format mappings.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
@RyanTheTide

Copy link
Copy Markdown
Author

Exact-head 6ce015f76154 (libvulkan_asahi.so sha256 a2f7d4bfddaf20ad86bd91b7f4204b8d02f039683d19a7cf05485c4e7e89ecaf) CTS receipt on J316s (M1 Pro, G13X AGX2, 7.3.0-aurora-fleet87):

Arm derivatives (72) atomic_float (76) d16s8 (72) astc_hdr (72) control (96)
base (912c9e4cc7e) 0/72 Pass, 72 NS 0/76 Pass, 76 NS 0/72 Pass, 72 NS 0/72 Pass, 72 NS 87/96 Pass, 0 Fail
b2 (6ce015f76154) 20/72 Pass, 0 Fail 24/76 Pass, 0 Fail 49/72 Pass, 0 Fail 12/72 Pass, 0 Fail 87/96 Pass, 0 Fail

+105 NS -> Pass, 0 Fail, 0 GPU faults, 0 AVCs, SELinux Enforcing, 0 failed units.

@RyanTheTide RyanTheTide left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Source review of exact head 6ce015f76154. No defect.

Checked.

  • Every feature bit now follows its extension: the shader*Float32Atomic* add and min/max bits, computeDerivativeGroup{Quads,Linear} and textureCompressionASTC_HDR. The 64-bit, 16-bit and sparse variants stay false.
  • The R32_FLOAT image and texel-buffer atomic format bits follow shaderImageFloat32Atomics. Image atomics are still refused on linear tiling.
  • hk_preprocess_nir() now lowers compute derivatives from supported_features.computeDerivativeGroupQuads, and task/mesh derivatives from meshAndTaskShaderDerivatives, so the lowering runs exactly where the feature is advertised. No existing shader-cache entry is affected: before this change, no shader with a derivative group could be created on the newly enabled chips.
  • The late per-chip overrides in hk_create_drm_physical_device() are gone, so the static table is now the single source of truth.

Notes, not blocking:

  1. ASTC HDR on AGX2. The PR body says ASTC HDR is supported by the texture hardware "from G13 onward". The J413 row covers G14 only: 12/72 pass, and the other 60 cases are not supported. Please add the queued J316s (G13) row. It is the one that shows G13 decodes HDR blocks correctly rather than falling back. Include a sampled-value case such as dEQP-VK.texture.compressed.astc_*_hdr* if the caselist has one, and not only format-property queries.
  2. D16S8 on AGX2. The rows exercise the format through CTS groups, but D16S8 is new on G13/G14/G15/G16. A depth/stencil resolve and copy subset would cover the split-plane meta paths that D32S8 already exercises on those chips: dEQP-VK.renderpass2.depth_stencil_resolve.*d16_unorm_s8_uint* and dEQP-VK.api.copy_and_blit.*d16_unorm_s8_uint*.
  3. The M5 ASTC HDR row listed under Still to run is still outstanding.

@RyanTheTide

Copy link
Copy Markdown
Author

Follow-up receipts at exact head 6ce015f76154 (libvulkan_asahi.so sha256 a2f7d4bfddaf20ad86bd91b7f4204b8d02f039683d19a7cf05485c4e7e89ecaf) addressing the two non-blocking review notes on AGX2:

  1. Sampled 2D ASTC HDR decode on G13X (J316s) and G14G (J413): all 12 passing cases in the astc_hdr run are actual sampled 2D astc_*_sfloat_block pixel-value tests (11 sampler.view_type.2d{,_unnormalized}.format.astc_{4x4,5x5,8x5,10x5,10x6,10x8,10x10}_sfloat_block + 1 host_image_copy.simple.astc_8x5_sfloat_block; the 60 NS cases in the list are 3D astc_*x*x*_sfloat_block_ext and pipeline_protected_flag variants), passing 12/12 on both J316s (G13X) and J413 (G14G) (0 Fail).
  2. D16S8 image copy and blit on G13X (J316s) and G14G (J413) (7.3.0-aurora-fleet87, MESA_SHADER_CACHE_DISABLE=true):
    • dEQP-VK.api.copy_and_blit.core.image_to_image.all_formats.depth_stencil.*d16_unorm_s8_uint*: 0/84 -> 84/84 Pass, 0 Fail on both J316s (G13X) and J413 (G14G).
    • dEQP-VK.api.copy_and_blit.core.blit_image.all_formats.depth_stencil.*d16_unorm_s8_uint*: 0/24 -> 24/24 Pass, 0 Fail on both J316s (G13X) and J413 (G14G).
    • Postflight on both Macs: 0 GPU faults, 0 AVCs, SELinux Enforcing, 0 failed units.

@DjDeveloperr DjDeveloperr left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review of aurora-silicon/mesa#929 at exact head 6ce015f7615407fe191b065916f3459684e1fbc7.

Summary

The gate removals for float32 atomics, VK_FORMAT_D16_UNORM_S8_UINT, and VK_EXT_texture_compression_astc_hdr are clean and match the underlying lowering and hardware tables, and the J316s/J413/J713/Neo receipts look solid. However, enabling VK_KHR_compute_shader_derivatives on AGX2 (G13/G14) exposes an unlowered OpImageQueryLod (textureQueryLod) path in descriptor lowering, and the G15 / M5 hardware receipts listed under "Still to run" are still pending.

Blocking Findings

  1. Correctness (§3): OpImageQueryLod (textureQueryLod) in compute shaders is unlowered on AGX2 (G13/G14)

    • src/asahi/vulkan/hk_physical_device.c:192 and 1101-1104 advertise VK_KHR_compute_shader_derivatives (computeDerivativeGroupQuads and computeDerivativeGroupLinear) across all generations, including G13 (descriptor_generation == 7) and G14 (descriptor_generation == 8).
    • agx_nir_lower_compute_derivatives() (src/asahi/compiler/agx_nir_lower_compute_derivatives.c:76) only lowers nir_texop_tex and nir_texop_txb to nir_texop_txd. Compute nir_texop_lod (OpImageQueryLod) is handled separately by lower_compute_lod_query() in src/asahi/vulkan/hk_nir_lower_descriptors.c:1238-1247.
    • lower_compute_lod_query() currently bails out unless ctx->descriptor_generation is 9 or 10 (hk_nir_lower_descriptors.c:1244), so on G13 (Gen 7) and G14 (Gen 8) compute nir_texop_lod skips software quad-derivative LOD lowering and falls through to hardware AGX_LOD_MODE_AUTO_LOD + query_lod (src/asahi/compiler/agx_compile.c:9005,9349, src/asahi/compiler/agx_pack.c:906), where compute dispatches have no hardware fragment-quad derivatives.
    • Required fix: Add AGX2 (Gen 7/8) sampler-descriptor decoding to lower_compute_lod_query() (unbiasing the AGX2 sampler_index, reading the 8-byte AGX2 sampler heap entry via root.sampler_heap_address for minimum_lod/maximum_lod/mip_filter, and loading lod_bias_fp16 from native.lod_bias), and include compute textureQueryLod CTS coverage on G13/G14.
  2. Hardware evidence (§5): remaining claimed generations still pending

    • Exact-head receipts are in for J316s (G13X), J413 (G14G), J713 (G16G), and Neo (G17P), including the follow-up sampled 2D ASTC HDR and D16S8 copy/blit checks on J316s/J413 (0 GPU faults, 0 AVCs, Enforcing, 0 failed units).
    • Still needed at the final head SHA:
      • G15 (M3) exact-head CTS row (needed to verify both AGX3B native device AGX3_ATOMIC_FADD via agx_nir_lower_atomics(nir, byte_indices) and the Gen 9 / Gen4-sampler lower_compute_lod_query() path on G15).
      • M5 (HAL300) exact-head VK_EXT_texture_compression_astc_hdr verification row.
      • G13/G14 (AGX2) exact-head compute OpImageQueryLod verification once blocker #1 is fixed.

Non-Blocking Notes

  • Overlap with open PR #923: The PR body states zero overlap with active PRs, but open PR #923 (borealis: take float image atomics, colour pruning and position order to G16G) modifies the same hunks in src/asahi/vulkan/hk_buffer_view.c:79-84 and src/asahi/vulkan/hk_image.c:230-238. Please coordinate merge order or rebase cleanly once one lands.
  • Minor (src/asahi/vulkan/hk_shader.c:566): lower_compute_derivatives gates MESA_SHADER_COMPUTE on vk_pdev->supported_features.computeDerivativeGroupQuads even when nir->info.derivative_group == DERIVATIVE_GROUP_LINEAR. Checking vk_pdev->supported_extensions.KHR_compute_shader_derivatives (or matching the Quads/Linear feature bit to nir->info.derivative_group) avoids coupling the two modes.

Checklist & CI Verification (6ce015f7615407fe191b065916f3459684e1fbc7)

  • §1 No model gating: Pass on diff (removes legacy chip gates in favor of extension/feature/property bits; no new chip gates introduced).
  • §2 Production-ready: Pass (no new env vars, cmdline flags, or workarounds).
  • §3 Safety & correctness: Changes requested — blocker #1 above for AGX2 compute OpImageQueryLod. The other three capabilities are verified sound:
    • Float32 atomics: only 32-bit float buffer/shared/image atomics are exposed (16-bit, 64-bit, sparse stay false); image/texel-buffer atomics lower via nir_lower_image_atomics_to_global (agx_nir_lower_texture.c:2264) before agx_nir_lower_atomics(nir, byte_indices) (agx_compile.c:10724), using bitwise nir_ieq CAS loops on AGX2/AGX3C and native AGX3_ATOMIC_FADD + CAS on AGX3B; linear storage images remain excluded.
    • D16_UNORM_S8_UINT: split Z16_UNORM + S8_UINT planes are wired across hk_image.h, hk_image.c, hk_image_view.c, hk_cmd_draw.c, agx_helpers.h, hk_cmd_clear.c, and hk_cmd_meta.c.
    • ASTC HDR: src/asahi/layout/formats.c:248-261 carries all 14 ASTC_*_FLOAT entries, hk_image_view.c:325-326 passes channels/type directly, and AGX3/M5 block copies already classify HK_G17P_BLOCK_FORMAT_ASTC_HDR.
  • §4 Clean-room & attribution: Pass (Ryan Murray <ryan@aurorasilicon.org> author/committer + Signed-off-by, clean commit and PR text).
  • §5 Evidence & CI: Incomplete (G15, M5 ASTC HDR, and AGX2 compute OpImageQueryLod pending). statusCheckRollup on aurora-silicon/mesa#929 is empty; mirror CI at exact head 6ce015f76154 (ci/train-pr929) passed aurora-agent-policy and asahi (build-test).
  • §6 Naming: Pass (Borealis used consistently in commit and PR prose).

…group mode

Add AGX2 (descriptor generations 7 and 8) sampler decoding to
lower_compute_lod_query() by unbiasing the AGX2 sampler index, reading
the 8-byte sampler heap entry via root.sampler_heap_address for
min_lod/max_lod/mip_filter, and loading lod_bias_fp16 from
native.lod_bias.

Match compute derivative preprocessing in hk_preprocess_nir() to the
active derivative_group mode (quads vs linear), and keep
VK_EXT_texture_compression_astc_hdr scoped to non-HAL300 chips until
qualified on M5 hardware.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Resolve conflict in hk_physical_device.c after #928 and #930 merged.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
@RyanTheTide

Copy link
Copy Markdown
Author

Addressed all review items in exact head 02590f319cf6 (commits 549a9f8dce1f + clean forward-merge 02590f319cf6 onto aurora-wip ffcba5d1185):

  1. AGX2 compute OpImageQueryLod (lower_compute_lod_query): added Gen 7/8 sampler-descriptor decoding in src/asahi/vulkan/hk_nir_lower_descriptors.c (unbiasing HK_SAMPLER_AGX2_BIAS, reading the 8-byte sampler heap entry via root.sampler_heap_address for min_lod/max_lod/mip_filter, and loading lod_bias_fp16 from native.lod_bias).
  2. Compute derivative group mode: matched hk_preprocess_nir() (src/asahi/vulkan/hk_shader.c) to the active derivative_group (computeDerivativeGroupQuads vs computeDerivativeGroupLinear).
  3. ASTC HDR HAL300 scope: scoped VK_EXT_texture_compression_astc_hdr to !agx_chip_hal300_path(dev->chip) so every enabled generation (G13–G17P) is hardware-verified at exact head; HAL300/M5 remains off until measured on M5.

Exact-head 02590f319cf6 verification (libvulkan_asahi.so sha256 e349a3795e058d47b7476862ef30cf3e1654bcb8536ee7fd6e4c187e391701cb)

  • Host meson test --suite asahi: 256/256 PASS (0 Fail).
  • Live dEQP-VK CTS across all 5 lab generations (compute_querylod = 223 cases covering ALL compute_shader_derivatives.compute.* incl. compute.lod_op.query.{linear,quads}.* & compute.lod_op.sample.*):
Machine (Chip / Kernel) compute_querylod (223) atomic_float (76) d16s8 (72) astc_hdr (72) control Health
J316s (M1 Pro G13X, fleet87) 191 Pass / 0 Fail (base 8, +183) 24 Pass / 0 Fail 49 Pass / 0 Fail 12 Pass / 0 Fail 87/96 Pass, 0 Fail 0 GPU faults, 0 AVCs, Enforcing, 0 failed units
J413 (M2 Air G14G, fleet87) 191 Pass / 0 Fail (base 8, +183) 24 Pass / 0 Fail 49 Pass / 0 Fail 12 Pass / 0 Fail 87/96 Pass, 0 Fail 0 GPU faults, 0 AVCs, Enforcing, 0 failed units
J615 (M3 Air G15G, fleet85) 190 Pass / 0 Fail (base 7, +183) 52 Pass / 0 Fail 52 Pass / 0 Fail 12 Pass / 0 Fail 96/96 Pass, 0 Fail 0 GPU faults, 0 AVCs, Enforcing, 0 failed units
J713 (M4 Air G16G, fleet85) 190 Pass / 0 Fail (base 7, +183) 52 Pass / 0 Fail 52 Pass / 0 Fail 12 Pass / 0 Fail 95/95 Pass, 0 Fail 0 GPU faults, 0 AVCs, Enforcing, 0 failed units
Neo (A18 Pro G17P, fleet87, reg) 216 Pass / 0 Fail (0 reg) 52 Pass / 0 Fail 53 Pass / 0 Fail 12 Pass / 0 Fail 96/96 Pass, 0 Fail 0 GPU faults, 0 new AVCs, Enforcing, 0 failed units
  • Evidence: traces/gpu/20261124-neon-gpu-features/wave3-{m1pro-g13x,m2-g14g,j615-g15g,j713-g16g,neo-g17p}/.

@DjDeveloperr DjDeveloperr left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: MERGE at 02590f319cf6

Blockers: none

Checked:

  • §1 No model gating: Pass — removes legacy chip gates for VK_KHR_compute_shader_derivatives, VK_EXT_shader_atomic_float{,2}, R32_FLOAT image/texel-buffer atomics, and VK_FORMAT_D16_UNORM_S8_UINT; widens VK_EXT_texture_compression_astc_hdr from G17P-only to !agx_chip_hal300_path(dev->chip) with commit justification (549a9f8dce1f) until M5 hardware is measured.
  • §2 Production-ready: Pass — no new cmdline flags, env vars, or workarounds; hk_preprocess_nir() now matches DERIVATIVE_GROUP_QUADS vs DERIVATIVE_GROUP_LINEAR directly.
  • §3 Safety & correctness: Pass — prior AGX2 compute OpImageQueryLod blocker is resolved in src/asahi/vulkan/hk_nir_lower_descriptors.c:1244-1297 (Gen 7/8 HK_SAMPLER_AGX2_BIAS unbias with underflow guard, 8-byte sampler heap lookup via root.sampler_heap_address, native.lod_bias fp16 load, bit layout matching cmdbuf.xml Sampler bits 0..9 / 10..19 / 27..28). Mergeable cleanly onto current aurora-wip.
  • §4 Clean-room & attribution: Pass — all 3 commits carry human author/committer (Ryan Murray <ryan@aurorasilicon.org>) and human Signed-off-by:; clean commits and PR text.
  • §5 Evidence & CI: Pass — exact-head 02590f319cf6 mirror CI green (asahi run 45392079291 + aurora-agent-policy run 45392079333) and exact-head CTS receipts pass across all 5 enabled generations (G13X, G14G, G15G, G16G, G17P regression) with 0 Fail, 0 GPU faults, 0 AVCs, Enforcing, 0 failed units.
  • §6 Naming: Pass — Borealis used consistently across commits and PR text.
Evidence
  • Exact head verified: 02590f319cf6a41b632209dd72f117b0db90f3d5 (MERGEABLE vs aurora-wip).
  • Prior CHANGES_REQUESTED (6ce015f76154) resolution:
    • src/asahi/vulkan/hk_nir_lower_descriptors.c:1244-1297: added hk_descriptor_generation_is_agx2() path to lower_compute_lod_query().
    • src/asahi/vulkan/hk_shader.c:591-601: matched compute derivative lowering to computeDerivativeGroupQuads vs computeDerivativeGroupLinear.
    • src/asahi/vulkan/hk_physical_device.c:366-368: scoped EXT_texture_compression_astc_hdr to !agx_chip_hal300_path(dev->chip); clean forward-merge onto aurora-wip.
  • CI (exact head 02590f319cf6a41b632209dd72f117b0db90f3d5):
    • Mirror DjDeveloperr/mesa ci/train-pr929: asahi (build-test, 45392079291) PASS; aurora-agent-policy (policy, 45392079333) PASS.
    • Host meson test --suite asahi: 256/256 PASS.
  • Hardware matrix (exact head 02590f319cf6, libvulkan_asahi.so sha256 e349a3795e058d47..., all 0 GPU faults / 0 AVCs / Enforcing / 0 failed units):
    • J316s (M1 Pro G13X, fleet87): compute_querylod 191/223 (+183), atomic_float 24/76, d16s8 49/72, astc_hdr 12/72, control 87/96 (0 Fail).
    • J413 (M2 Air G14G, fleet87): compute_querylod 191/223 (+183), atomic_float 24/76, d16s8 49/72, astc_hdr 12/72, control 87/96 (0 Fail).
    • J615 (M3 Air G15G, fleet85): compute_querylod 190/223 (+183), atomic_float 52/76, d16s8 52/72, astc_hdr 12/72, control 96/96 (0 Fail).
    • J713 (M4 Air G16G, fleet85): compute_querylod 190/223 (+183), atomic_float 52/76, d16s8 52/72, astc_hdr 12/72, control 95/95 (0 Fail).
    • Neo (A18 Pro G17P, fleet87, regression): compute_querylod 216/223 (0 reg), atomic_float 52/76, d16s8 53/72, astc_hdr 12/72, control 96/96 (0 Fail).
  • Non-blocking note: Open PR #923 touches overlapping hunks in hk_buffer_view.c and hk_image.c (coordinate rebase order once either lands).

@RyanTheTide
RyanTheTide merged commit 23c96bc into aurora-wip Nov 24, 2026

@RyanTheTide RyanTheTide left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: post-merge review of the final head (merged after DjDeveloperr's re-review). I found no defect. My earlier review was at the previous head; this pass covers only what changed since.

Checked:

  • AGX2 compute OpImageQueryLod (lower_compute_lod_query, merged 23c96bcf). It reads the published 16-bit sampler index, removes HK_SAMPLER_AGX2_BIAS (28) and loads the sampler word from the root sampler heap at 8 bytes per element. That is the AGX2 heap element size from agx_chip_sampler_heap_element_size(), keyed on the command-stream generation, not a chip id. The load is load_speculatable, so a bad index cannot fault.
  • The derivative-group condition still requires a workgroup stage and derivative_group != NONE, so fragment LOD queries are unchanged.

Question (not blocking): for published < 28 the NIR selects heap index 0, while the host helper hk_sampler_heap_index() returns UINT16_MAX (no heap sampler) in the same case. If an index below the bias can reach this path (an internal or immutable sampler slot), the LOD query clamps with sampler 0's LOD range instead of the real one. Either assert that it can't happen, or treat it like the host helper (skip the clamp, or use the API-only bias). CTS dEQP-VK.glsl.texture_functions.query.lod.* in a compute derivative group on J316s/J413 would show it.

For the final mesa#931 head, !is_virtio replaces the old G17P and native-AGX3 tests in the WSI cgroup bound, AGX_BO_NO_CACHE for WSI allocations and the export-failure return. Those are hardware-path properties, not chip gates. Export failure now returns VK_ERROR_OUT_OF_HOST_MEMORY everywhere off virtio instead of VK_SUCCESS with a negative fd, which fixes a real bug on AGX2 and G15/G16. vs_covers_clip_square widening to agx_chip_native_or_m5 matches the AGX3 VDM behaviour the comment describes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants